//package src;

import java.awt.*;
import java.awt.geom.*;

public class ShapeRect extends Shape {
	
  	private int left, top;          				
  	private int width, height;         			
  	private Rectangle2D.Double rect;		

  	public ShapeRect(int left, int top, int width, int height, Color color)
  	{
    		super(color);
    		this.left = left;
    		this.top = top;
    		this.width = width;
    		this.height = height;
  	}

  	public void draw(Graphics g)
  	{
		Graphics2D g2d = (Graphics2D) g;							

    	g2d.setColor(getColor());										
    	rect = new Rectangle2D.Double(left, top, width, height);
    	g2d.draw(rect);

  	}

	public int setLeftPoint(int x)		
	{
		return left = x;
	}
	
	public int setTopPoint(int y)
	{
		return top = y;
	}

}

